import pygame
def draw_stroke_rect(win, rect_seat, rect_size, rect_outline, stroke_color, rect_color):
    rect1 = rect_seat + rect_size
    new_rect_seat = rect_seat[:]  # 使用切片或复制来创建新的列表
    new_rect_seat[0] += rect_outline
    new_rect_seat[1] += rect_outline
    new_rect_size = rect_size[:]  # 使用切片或复制来创建新的列表
    new_rect_size[0] -= 2 * rect_outline
    new_rect_size[1] -= 2 * rect_outline
    rect2 = new_rect_seat + new_rect_size
    pygame.draw.rect(win, rect_color, rect1)
    pygame.draw.rect(win, stroke_color, rect2)


def amplitude_reduction(x, y, xmax, ymax):
    mouse_x, mouse_y = x, y
    if mouse_x < 0:
        mouse_x = 0
    if mouse_x > xmax:
        mouse_x = xmax
    if mouse_y < 0:
        mouse_y = 0
    if mouse_y > ymax:
        mouse_y = ymax
    return mouse_x, mouse_y



